package
{
	import flash.display.Graphics;
	import flash.display.Shape;

	public class Flyer extends Shape
	{
		//
		private var m_pParent:MomoTank = null;
		public function get master():MomoTank{
			return m_pParent;
		}
		//
		private var m_iAtkPoint:Number = 0;
		private var m_iBrkPoint:Number = 0;
		private var m_iWavPoint:Number = 0;
		private var m_iFirePoint:Number = 0;
		//
		private var m_iFlyMode:int = 0;	//弹道
		private var m_iSpeed:Number = 0;//速度
		//
		public function get atk():Number{
			return m_iAtkPoint;
		}
		public function get brk():Number{
			return m_iBrkPoint;
		}
		public function get wav():Number{
			return m_iWavPoint;
		}
		public function get fire():Number{
			return m_iFirePoint;
		}
		public function get flyMode():int{
			return m_iFlyMode;
		}
		public function get speed():Number{
			return m_iSpeed;
		}
		//
		public function Flyer( whos:MomoTank )
		{
			super();
			InitTexture();
			m_pParent=whos;
			//根据whos调整x和y
			//求炮口坐标
			x=whos.gunX;
			y=whos.gunY;
			rotation=whos.gunRotation;
			//战斗数据
			m_iAtkPoint=whos.gun.atk;
			m_iBrkPoint=whos.gun.brk;
			m_iWavPoint=whos.gun.wav;
			m_iFirePoint=whos.gun.fire;
			m_iFlyMode=whos.gun.flyerMode;
			m_iSpeed=whos.gun.initSpeed;
		}
		//
		private function InitTexture():void{
			var g:Graphics = this.graphics;
			g.lineStyle(1.3,0xffffff);
			g.moveTo(-4,0);
			g.lineTo(1,0);
		}
		//
		public function Updata():void{
			x+=m_iSpeed*fun.cos(rotation);
			y+=m_iSpeed*fun.sin(rotation);
		}
		//
	}
}